package com.miya.demo.handler.order.handler;

import com.miya.demo.handler.order.AbstractOrderHandler;
import com.miya.demo.handler.order.OrderContexts;
import com.miya.demo.handler.order.OrderHandlerChainContext;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 订单数据初始化处理程序
 *
 * @author CaiXiaowei
 * @date 2022/09/30
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class DataInitOrderHandler extends AbstractOrderHandler<OrderContexts> {

    /**
     * @param handlerChainContext
     * @param orderContexts
     */
    @Override
    public void doWork(OrderHandlerChainContext handlerChainContext, OrderContexts orderContexts) {
        log.info("step1--->OrderDataInitHandler--->订单数据初始化");

        handlerChainContext.fireNextContext(orderContexts);
    }

    /**
     * @param handlerChainContext
     * @param orderContexts
     */
    @Override
    public void cancelWork(OrderHandlerChainContext handlerChainContext, OrderContexts orderContexts) {

    }
}
